package container.map;

import container.set.User;

import java.util.Map;
import java.util.TreeMap;

public class TestTreeMap
{
    public static void main (String[] args)
    {
        Map<User, String> treeMap1 = new TreeMap<>();
        
        User user1 = new User(18, "oldlu");
        User user2 = new User(21, "chen");
        User user3 = new User(22, "sxz");
        
        treeMap1.put(user1, user1.getUsername());
        treeMap1.put(user2, user2.getUsername());
        treeMap1.put(user3, user3.getUsername());
    
        for(User temp : treeMap1.keySet())
        {
            System.out.println(temp + "--------" + treeMap1.get(temp));
        }
    }
}
